using ERP.Common.Results;
using ERP.Team.ProductionSystem;
using ERP.ERPSystem.ProductionSystem.Dto;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;

namespace ERP.ERPSystem.ProductionSystem
{
    /// <summary>
    /// 生产排产服务接口
    /// </summary>
    public interface IProductionSchedulingServices : IApplicationService
    {
        /// <summary>
        /// 分页查询生产排产列表
        /// </summary>
        /// <param name="queryDto">查询条件</param>
        /// <returns>分页排产列表</returns>
        Task<APIPaging<ProductionSchedulingModel>> GetProductionSchedulingList(ProductionSchedulingQueryDto queryDto);

        /// <summary>
        /// 根据ID获取生产排产详情
        /// </summary>
        /// <param name="id">排产ID</param>
        /// <returns>排产详情</returns>
        Task<ProductionSchedulingModel> GetProductionSchedulingById(int id);

        /// <summary>
        /// 添加生产排产
        /// </summary>
        /// <param name="productionSchedulingDto">生产排产信息</param>
        /// <returns>排产ID</returns>
        Task<int> AddProductionScheduling(ProductionSchedulingDto productionSchedulingDto);

        /// <summary>
        /// 更新生产排产
        /// </summary>
        /// <param name="productionSchedulingDto">生产排产信息</param>
        /// <returns>更新结果</returns>
        Task<bool> UpdateProductionScheduling(ProductionSchedulingDto productionSchedulingDto);

        /// <summary>
        /// 批量删除生产排产
        /// </summary>
        /// <param name="ids">排产ID数组</param>
        /// <returns>删除结果</returns>
        Task<bool> DeleteProductionSchedulings(int[] ids);

        /// <summary>
        /// 根据工单编码获取排产信息
        /// </summary>
        /// <param name="workOrderCode">工单编码</param>
        /// <returns>排产信息</returns>
        Task<ProductionSchedulingModel> GetProductionSchedulingByWorkOrderCode(string workOrderCode);

        /// <summary>
        /// 根据来源单据号获取排产列表
        /// </summary>
        /// <param name="sourceDocumentNo">来源单据号</param>
        /// <returns>排产列表</returns>
        Task<APIPaging<ProductionSchedulingModel>> GetProductionSchedulingBySourceDocument(string sourceDocumentNo, int page = 1, int limit = 10);

        /// <summary>
        /// 调整排产数量
        /// </summary>
        /// <param name="id">排产ID</param>
        /// <param name="adjustQuantity">调整数量</param>
        /// <returns>调整结果</returns>
        Task<bool> AdjustProductionQuantity(int id, int adjustQuantity);
    }
} 